//
//  ManagementMultipleCell.m
//  QRMaster
//
//  Created by myApple on 16/5/5.
//  Copyright © 2016年 myApple. All rights reserved.
//

#import "ManagementMultipleCell.h"

@interface ManagementMultipleCell()
{
    UIImageView * titleImageView;
    UILabel * titleLabel;
    UILabel * communtyNameLabel;
}

@end

@implementation ManagementMultipleCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        //        btnToTimeId = [[NSMutableArray alloc]init];
        [self prepareView];
    }
    return self;
}

-(void)prepareView
{
    float x = 22;
    float y = 15;
    float width = 28;
    float height = 28;
    
    titleImageView = [[UIImageView alloc]initWithFrame:CGRectMake(x, y, width, height)];
    [self.contentView addSubview:titleImageView];
    
    
    x = 72;
    y = 15;
    width = UI_SCREEN_WIDTH - x - 24;
    height = 20;
    titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    titleLabel.font = [UIFont systemFontOfSize:16.0];
    titleLabel.textColor = UIColorFromRGB(0x333333);
    [self.contentView addSubview:titleLabel];
    
    
    x = 72;
    y += height + 5;
    height = 20;
    communtyNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(x, y, width, height)];
    communtyNameLabel.font = [UIFont systemFontOfSize:14.0];
    communtyNameLabel.textColor = UIColorFromRGB(0x2db7f5);
    [self.contentView addSubview:communtyNameLabel];
    
    
}

-(void)setImageName:(NSString *)imageName
{
    _imageName = imageName;
    UIImage * image = [UIImage imageNamed:imageName];
    titleImageView.frame = CGRectMake(titleImageView.frame.origin.x, (68 - image.size.height) / 2.0, image.size.width, image.size.height);
    titleImageView.image = [UIImage imageNamed:imageName];
}


-(void)setTextTitle:(NSString *)textTitle
{
    _textTitle = textTitle;
    titleLabel.text = textTitle;
}

-(void)setCommunityName:(NSString *)communityName
{
    _communityName = communityName;
    communtyNameLabel.text = communityName;
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
